package svgedit.gui.actions;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import svgedit.gui.Frame;
import svgedit.gui.commands.CommandStack;

/**
 * Combines selected elements into a group.
 */
@SuppressWarnings("serial")
public class UndoAction extends AbstractAction
{

	private Frame frame;

	/** Create this action for the given frame */
	public UndoAction(Frame frame)
	{
		super("Undo");
		this.frame = frame;
	}

	@Override
	public void actionPerformed(ActionEvent arg0)
	{
		CommandStack.getInstance().undo();		
		frame.repaint();		
	}

}
